<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模拟消息推送</title>
    <script type="text/javascript">
        //需要判断浏览器支不支持，可以去w3c进行查看

        var source = new EventSource('sse/get_data');
        source.onmessage = function (event) {
            console.info(event.data);
            document.getElementById('result').innerText = event.data
        };
    </script>
</head>

<body>
模拟股票行情
<div>xdclass test</div>
<div id="result"></div>
</body>

</html>